<!--{eval $_TPL['titles'] = array('好友');}-->
<!--{template header}-->

<!--{if $space[self]}-->
<div class="searchbar">
<table cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<script type="text/javascript" src="source/script_autocomplete.js"></script>
			<table cellspacing="0" cellpadding="0">
				<tr>
					<td style="padding: 0;"><input type="text" id="username" name="username" value="搜索好友" onfocus="if(this.value=='搜索好友')this.value='';" class="t_input" tabindex="1" onclick="auc.handleEvent(this.value ,event);" onkeyup="auc.handleEvent(this.value ,event);inputKeyDown(event, 1);" onkeydown="closeOpt(event);inputKeyDown(event);" autocomplete="off" style="width: 160px; border-right: none;" /></td>
					<td style="padding: 0;"><a href="javascript:searchFriend();"><img src="image/search_btn.gif" alt="搜索" /></a></td>
				</tr>
			</table>
			<div id="username_menu" class="ajax_selector" onclick="$('username_menu').style.display='none';" style="display:none">
				<div class="ajax_selector_option" style="width: 181px; height: 100px;">
					<a href="javascript:;" onclick="$('username_menu').style.display='none';" class="float_del" style="margin-right: 5px;">a</a>
					<ul id="friendlist" class="blocklink"></ul>
				</div>
			</div>
		</td>
	</tr>
</table>
</div>
<h2 class="title"><img src="image/icon/friend.gif" />好友</h2>
<div class="tabs_header">
	<ul class="tabs">
		<li$actives[me]><a href="space.php?uid=$space[uid]&do=friend"><span>好友列表</span></a></li>
		<li><a href="cp.php?ac=friend&op=find"><span>可能认识的人</span></a></li>
		<!--{if empty($_SCONFIG['closeinvite'])}-->
		<li><a href="cp.php?ac=invite"><span>邀请好友</span></a></li>
		<!--{/if}-->
	</ul>
</div>
<div id="content" style="width: 640px;">

	<div class="c_mgs"><div class="ye_r_t"><div class="ye_l_t"><div class="ye_r_b"><div class="ye_l_b">
		<!--{if $_GET['view']=='blacklist'}-->
			加入到黑名单的用户，将会从您的好友列表中删除。同时，对方将不能进行与您相关的打招呼、踩日志、加好友、评论、留言、短消息等互动行为。
		<!--{elseif $_GET['view']=='me'}-->
			好友列表按照好友热度高低排序<br>
			好友热度是系统根据您与好友之间交互的动作自动累计的一个参考值，数值越大，表示您与这位好友互动越频繁。
		<!--{elseif $_GET['view']=='online'}-->
			<!--{if $_GET['type'] == 'friend'}-->
			这些好友当前在线，赶快去拜访一下吧
			<!--{elseif $_GET['type']=='near'}-->
			通过系统匹配，这些朋友就在您附近，您可能认识他们
			<!--{else}-->
			显示当前全部在线的用户
			<!--{/if}-->
		<!--{elseif $_GET['view']=='visitor'}-->
			他们拜访过您，回访一下吧
		<!--{elseif $_GET['view']=='trace'}-->
			您曾经拜访过的用户列表
		<!--{elseif $_GET['view']=='me'}-->
		<!--{/if}-->
	</div></div></div></div></div>
	
	<!--{if $_GET['view']=='blacklist'}-->
	<div class="h_status">
		<h2>添加新黑名单用户</h2>
		<form method="post" name="blackform" action="cp.php?ac=friend&op=blacklist&start=$_GET[start]">
			用户名：<input type="text" name="username" value="" size="15" class="t_input">
			<input type="submit" name="blacklistsubmit_btn" id="moodsubmit_btn" value="添加" class="submit">
			<input type="hidden" name="blacklistsubmit" value="true" />
		<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		</form>
	</div>
	<!--{/if}-->
	
	<!--{if $list}-->
	<div class="thumb_list" id="friend_ul">
		<ul>
		<!--{loop $list $key $value}-->
			<li>
				<div class="avatar48"><a href="space.php?uid=$value[uid]"><img src="<!--{avatar($value[uid],small)}-->" alt="{$_SN[$value[uid]]}" width="48" height="48" /></a></div>
				<div class="thumbTitle"><p<!--{if $ols[$value[uid]]}--> class="online_icon_p"<!--{/if}-->><a href="space.php?uid=$value[uid]"<!--{eval g_color($value[groupid]);}-->>{$_SN[$value[uid]]}</a> <!--{eval g_icon($value[groupid]);}--></p></div>
				<!--{if $value[note]}--><div>$value[note]</div><!--{/if}-->
				
				<!--{if $_GET['view']=='blacklist'}-->
					<div class="setti"><a href="cp.php?ac=friend&op=blacklist&subop=delete&uid=$value[uid]&start=$_GET[start]">黑名单除名</a></div>
				<!--{elseif $_GET['view']=='visitor' || $_GET['view'] == 'trace'}-->
					<div class="setti"><!--{date('n月j号',$value[dateline],1)}--></div>
				<!--{elseif $_GET['view']=='online'}-->
					<div class="setti"><!--{date('H:i',$ols[$value[uid]],1)}--></div>
				<!--{else}-->
					<!--{if $ols[$value[uid]]}--><div class="setti"><!--{date('H:i',$ols[$value[uid]],1)}--></div><!--{/if}-->
					<div class="setti">
					<!--{if $value['num']}-->热度($value[num])<span class="pipe">|</span><!--{/if}-->
					<!--{if !$value['isfriend']}-->
					<a href="cp.php?ac=friend&op=add&uid=$value[uid]" id="a_friend_$key" onclick="ajaxmenu(event, this.id, 99999, '', -1)">加为好友</a>
					<!--{else}-->
					<a href="cp.php?ac=friend&op=changegroup&uid=$value[uid]" id="a_group_$key" onclick="ajaxmenu(event, this.id, 99999)">分组</a><span class="pipe">|</span>
					<a href="cp.php?ac=friend&op=ignore&uid=$value[uid]" id="a_ignore_$key" onclick="ajaxmenu(event, this.id, 99999)">删除</a>
					<!--{/if}-->
					</div>
				<!--{/if}-->
			</li>
		<!--{/loop}-->
		</ul>
	</div>
	<div class="page">$multi</div>

	<!--{else}-->
	<div class="c_form">
		没有相关用户列表。
	</div>
	<!--{/if}-->
	
</div>


<div id="sidebar" style="width: 150px; overflow:visible;">
	<div class="cat">
		<h3>
			好友菜单
		</h3>
		<ul>
			<li{$a_actives[me]}><a href="space.php?uid=$space[uid]&do=friend">全部好友列表</a></li>
			<li{$a_actives[onlinefriend]}><a href="space.php?uid=$space[uid]&do=friend&view=online&type=friend">当前在线的好友</a></li>
			<li{$a_actives[onlinenear]}><a href="space.php?uid=$space[uid]&do=friend&view=online&type=near">就在我附近的朋友</a></li>
			<li{$a_actives[visitor]}><a href="space.php?uid=$space[uid]&do=friend&view=visitor">我的访客</a></li>
			<li{$a_actives[trace]}><a href="space.php?uid=$space[uid]&do=friend&view=trace">我的足迹</a></li>
			<li{$a_actives[blacklist]}><a href="space.php?uid=$space[uid]&do=friend&view=blacklist">我的黑名单</a></li>
		</ul>
	</div>
	
	<!--{if $groups}-->
	<div class="cat">
		<h3>
			<span class="r_option"><a href="cp.php?ac=friend&op=group">批量分组</a></span>
			好友分组
		</h3>
		<ul class="post_list">
			<li><a href="space.php?do=friend&group=-1">全部好友</a></li>
			<!--{loop $groups $key $value}-->
			<li>
				<!--{if isset($space['privacy']['filter_gid'][$key])}--><span class="gray">[屏蔽]</span><!--{/if}--> <a href="space.php?do=friend&group=$key" $groupselect[$key]><span id="friend_groupname_$key">$value</span></a>
				<!--{if $key}-->
				<a href="cp.php?ac=friend&op=groupname&group=$key" id="c_edit_$key" onclick="ajaxmenu(event, this.id, 99999, '', -1)" title="编辑用户组名" class="c_edit">编辑</a>
				<!--{/if}-->
				<a href="cp.php?ac=friend&op=groupignore&group=$key" id="c_ignore_$key" onclick="ajaxmenu(event, this.id, 99999)" title="屏蔽用户组动态" class="c_delete">屏蔽</a>
			</li>
			<!--{/loop}-->
		</ul>
	</div>
	<!--{/if}-->

</div>
<script type="text/javascript">
	var close = true;
	var auc = new sAutoComplete("auc", "username_menu", "friendlist", "username", 0, searchFriend);
	auc.addItem('$friendstr');
	function closeOpt(evt) {
		if(evt.keyCode==9) {
			$('username_menu').style.display='none';
		}
	}
	function inputKeyDown(event, search) {
		if(isUndefined(search)) search = 0;
		if(event.keyCode == 13){
			if(search) searchFriend();
			doane(event);
		}
	}
	function searchFriend() {
		var username = $('username').value;
		if(username == '搜索好友' || username == '') {
			alert('请输入好友名称');
		} else {
			location.href ='space.php?do=friend&key='+username;
		}
	}
</script>

<!--{else}-->
<!--{eval 
	$_TPL['spacetitle'] = "好友";
}-->
	<!--{template space_menu}-->
	<div class="c_form l_status">共有 $space[friendnum] 个好友</div>
	<!--{template space_list}-->
	
<!--{/if}-->



<!--{template footer}-->
